home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Performance Co-Pilot 1.3
/
SGI Performance Co-Pilot 1.3.iso
/
dist
/
dist6.3
/
pcp.idb
/
usr
/
sbin
/
nfsvis.z
/
nfsvis
Wrap
Text File
|
1997-04-03
|
11KB
|
341 lines
#!/bin/sh
#
# Copyright (c) 1994 Silicon Graphics, Inc.
# ALL RIGHTS RESERVED.
#
# U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND
# Use, duplication or disclosure by the Government is subject to
# restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph
# (c)(1)(ii) of the Rights in Technical Data and Computer Software clause
# at DFARS 252.227-7013 and/or similar or successor clauses in the FAR,
# or the DOD or NASA FAR Supplement. Contractor/manufacturer is Silicon
# Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
#
# THIS SOFTWARE CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION OF
# SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION, DISTRIBUTION, OR
# DISCLOSURE IS STRICTLY PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN
# PERMISSION OF SILICON GRAPHICS, INC.
# /
#
# $Id: nfsvis.sh,v 2.11 1997/03/21 08:52:13 kenmcd Exp $
#
tmp=/tmp/$$
trap "rm -f $tmp.*; exit" 0 1 2 3 15
rm -f $tmp.*
. /usr/pcp/lib/pmview-args
_usage()
{
echo 'Usage: nfsvis [options]
options:
-c version Monitor NFS version (integer) client metrics [default 2]
-m maxrate maximum request rate expected (integer) [default 120]
-s version Monitor NFS version (integer) server metrics [default 2]
-v version generate scene for different versions of pmview [default 2]
-V verbose/diagnostic output
pmview(1) options:'
_pmview_usage
echo
echo 'Default title is: NFS Version 2 Request Traffic for Host'
}
max=120
client=2
server=2
type=total
Type=Total
verbose=false
version="2"
_pmview_args "$@"
if [ -n "$otherArgs" ]
then
while getopts "?c:m:s:v:V" c $otherArgs
do
case $c
in
c)
client=$OPTARG
if [ "$client" != 2 -a "$client" != 3 ]
then
echo "$prog: only NFS 2 and NFS 3 client metrics supported"
_usage
exit 1
fi
;;
m)
max=$OPTARG
# and now the obscure +ve integer checking bit
# ...note the creative use of unary - to prevent leading signs
if [ "X-$max" != "X`expr 0 + -$max 2>/dev/null`" ]
then
echo "$prog: -m must have a positive integral argument"
_usage
exit 1
fi
;;
s)
server=$OPTARG
if [ "$server" != 2 -a "$server" != 3 ]
then
echo "$prog: only NFS 2 and NFS 3 server metrics supported"
_usage
exit 1
fi
;;
v)
version=$OPTARG
if [ $version != "1" -a $version != "2" ]
then
echo "$prog: only versions 1 and 2 supported"
_usage
exit 1
fi
;;
V)
verbose=true
;;
?)
_usage
exit 1
;;
esac
done
set - $otherArgs
shift `expr $OPTIND - 1`
if [ $# -gt 0 ]
then
_usage
exit 1
fi
fi
if [ "X$arch" != X ]
then
host=`pmdumplog -l $arch | awk '/^Performance/ {print $5}' | sed -e 's/,//g'`
[ "X$host" = X ] && host="unknown host"
host="$host (Archive $arch)"
source="-a $arch"
elif [ "X$host" = X ]
then
host=`/usr/bsd/hostname`
source=
else
source="-h $host"
fi
if [ "$client" = "3" ]
then
if pminfo -f $source irix.nfs3.client 2>&1 | grep Unknown > /dev/null 2>&1
then
echo "$prog: NFS Version 3 client metrics not supported on Host $host"
exit 1
fi
fi
if [ "$server" = "3" ]
then
if pminfo -f $source irix.nfs3.server 2>&1 | grep Unknown > /dev/null 2>&1
then
echo "$prog: NFS Version 3 server metrics not supported on Host $host"
exit 1
fi
fi
if [ -z "$titleArg" ]
then
titleArg="NFS Client V$client & Server V$server Request Traffic for Host $host"
fi
if [ $version = "2" ]
then
#
# pmview 2.0
#
cat << End-of-File > $tmp.config
pmview Version 2.0
#
# nfsvis
#
_scale 1.05
_colorlist colors (red1 green1 blue1)
_grid hide (
_label 2 0 (
_direction down
_size large
_text "Client"
)
_labeledbar 0 0 east (
_metrics (
End-of-File
if [ "$client" = "2" ]
then
cat << End-of-File >> $tmp.config
irix.nfs.client.reqs[create,remove,rename,link,symlink,mkdir,rmdir] $max
irix.nfs.client.reqs[getattr,setattr,lookup,readdir,fsstat,root] $max
irix.nfs.client.reqs[readlink,read,write,wrcache] $max
End-of-File
else
cat << End-of-File >> $tmp.config
irix.nfs3.client.reqs[create,remove,rename,link,symlink,mkdir,rmdir,mknod] $max
irix.nfs3.client.reqs[getattr,setattr,lookup,readdir,fsstat,access,readdir+,fsinfo,pathconf] $max
irix.nfs3.client.reqs[readlink,read,write,commit] $max
End-of-File
fi
cat << End-of-File >> $tmp.config
)
_metriclabels ( "dir" "attr" "data" )
_colorlist colors
)
_label 2 2 (
_direction down
_size large
_text "Server"
)
_labeledbar 0 2 east (
_metrics (
End-of-File
if [ "$server" = "2" ]
then
cat << End-of-File >> $tmp.config
irix.nfs.server.reqs[create,remove,rename,link,symlink,mkdir,rmdir] $max
irix.nfs.server.reqs[getattr,setattr,lookup,readdir,fsstat,root] $max
irix.nfs.server.reqs[readlink,read,write,wrcache] $max
End-of-File
else
cat << End-of-File >> $tmp.config
irix.nfs3.server.reqs[create,remove,rename,link,symlink,mkdir,rmdir,mknod] $max
irix.nfs3.server.reqs[getattr,setattr,lookup,readdir,fsstat,access,readdir+,fsinfo,pathconf] $max
irix.nfs3.server.reqs[readlink,read,write,commit] $max
End-of-File
fi
cat << End-of-File >> $tmp.config
)
_metriclabels ( "dir" "attr" "data" )
_colorlist colors
)
)
End-of-File
else
#
# pmview 1.0
#
cat <<End-of-File > $tmp.config
# pmview 1.0
#
# nfsvis
#
End-of-File
if [ "$server" = "2" ]
then
cat <<End-of-File >> $tmp.config
5 0 0.0 1.0 0.0 $max srvr-dir irix.nfs.server.reqs create
5 1 0.0 0.0 1.0 $max - irix.nfs.server.reqs remove
5 2 1.0 0.0 0.0 $max - irix.nfs.server.reqs rename
5 3 0.0 1.0 1.0 $max - irix.nfs.server.reqs link
5 4 1.0 1.0 0.0 $max - irix.nfs.server.reqs symlink
5 5 1.0 0.0 1.0 $max - irix.nfs.server.reqs mkdir
5 6 0.0 1.0 0.5 $max - irix.nfs.server.reqs rmdir
6 0 0.5 0.0 1.0 $max srvr-attr irix.nfs.server.reqs getattr
6 1 1.0 0.5 0.0 $max - irix.nfs.server.reqs setattr
6 2 1.0 0.0 0.5 $max - irix.nfs.server.reqs lookup
6 3 0.5 1.0 0.0 $max - irix.nfs.server.reqs readdir
6 4 0.0 1.0 0.0 $max - irix.nfs.server.reqs fsstat
6 5 0.0 0.5 1.0 $max - irix.nfs.server.reqs root
7 0 0.0 0.0 1.0 $max srvr-data irix.nfs.server.reqs readlink
7 1 1.0 0.0 0.0 $max - irix.nfs.server.reqs read
7 2 0.0 1.0 1.0 $max - irix.nfs.server.reqs write
7 3 1.0 1.0 0.0 $max - irix.nfs.server.reqs wrcache
End-of-File
else
cat <<End-of-File >> $tmp.config
5 0 0.0 1.0 0.0 $max srvr-dir irix.nfs3.server.reqs create
5 1 0.0 0.0 1.0 $max - irix.nfs3.server.reqs remove
5 2 1.0 0.0 0.0 $max - irix.nfs3.server.reqs rename
5 3 0.0 1.0 1.0 $max - irix.nfs3.server.reqs link
5 4 1.0 1.0 0.0 $max - irix.nfs3.server.reqs symlink
5 5 1.0 0.0 1.0 $max - irix.nfs3.server.reqs mkdir
5 6 0.0 1.0 0.5 $max - irix.nfs3.server.reqs rmdir
5 7 0.5 0.0 1.0 $max - irix.nfs3.server.reqs mknod
6 0 0.5 0.0 1.0 $max srvr-attr irix.nfs3.server.reqs getattr
6 1 1.0 0.5 0.0 $max - irix.nfs3.server.reqs setattr
6 2 1.0 0.0 0.5 $max - irix.nfs3.server.reqs lookup
6 3 0.5 1.0 0.0 $max - irix.nfs3.server.reqs readdir
6 4 0.0 1.0 0.0 $max - irix.nfs3.server.reqs fsstat
6 5 0.0 0.0 1.0 $max - irix.nfs3.server.reqs access
6 6 1.0 0.0 0.0 $max - irix.nfs3.server.reqs readdir+
6 7 0.0 1.0 1.0 $max - irix.nfs3.server.reqs fsinfo
6 8 1.0 1.0 0.0 $max - irix.nfs3.server.reqs pathconf
7 0 0.0 0.0 1.0 $max srvr-data irix.nfs3.server.reqs readlink
7 1 1.0 0.0 0.0 $max - irix.nfs3.server.reqs read
7 2 0.0 1.0 1.0 $max - irix.nfs3.server.reqs write
7 3 1.0 0.5 0.0 $max - irix.nfs3.server.reqs commit
End-of-File
fi
if [ "$client" = "2" ]
then
cat <<End-of-File >> $tmp.config
1 0 0.0 1.0 0.0 $max clnt-dir irix.nfs.client.reqs create
1 1 0.0 0.0 1.0 $max - irix.nfs.client.reqs remove
1 2 1.0 0.0 0.0 $max - irix.nfs.client.reqs rename
1 3 0.0 1.0 1.0 $max - irix.nfs.client.reqs link
1 4 1.0 1.0 0.0 $max - irix.nfs.client.reqs symlink
1 5 1.0 0.0 1.0 $max - irix.nfs.client.reqs mkdir
1 6 0.0 1.0 0.5 $max - irix.nfs.client.reqs rmdir
2 0 0.5 0.0 1.0 $max clnt-attr irix.nfs.client.reqs getattr
2 1 1.0 0.5 0.0 $max - irix.nfs.client.reqs setattr
2 2 1.0 0.0 0.5 $max - irix.nfs.client.reqs lookup
2 3 0.5 1.0 0.0 $max - irix.nfs.client.reqs readdir
2 4 0.0 1.0 0.0 $max - irix.nfs.client.reqs fsstat
2 5 0.0 0.5 1.0 $max - irix.nfs.client.reqs root
3 0 0.0 0.0 1.0 $max clnt-data irix.nfs.client.reqs readlink
3 1 1.0 0.0 0.0 $max - irix.nfs.client.reqs read
3 2 0.0 1.0 1.0 $max - irix.nfs.client.reqs write
3 3 1.0 1.0 0.0 $max - irix.nfs.client.reqs wrcache
End-of-File
else
cat <<End-of-File >> $tmp.config
1 0 0.0 1.0 0.0 $max clnt-dir irix.nfs3.client.reqs create
1 1 0.0 0.0 1.0 $max - irix.nfs3.client.reqs remove
1 2 1.0 0.0 0.0 $max - irix.nfs3.client.reqs rename
1 3 0.0 1.0 1.0 $max - irix.nfs3.client.reqs link
1 4 1.0 1.0 0.0 $max - irix.nfs3.client.reqs symlink
1 5 1.0 0.0 1.0 $max - irix.nfs3.client.reqs mkdir
1 6 0.0 1.0 0.5 $max - irix.nfs3.client.reqs rmdir
1 7 0.5 0.0 1.0 $max - irix.nfs3.client.reqs mknod
2 0 0.5 0.0 1.0 $max clnt-attr irix.nfs3.client.reqs getattr
2 1 1.0 0.5 0.0 $max - irix.nfs3.client.reqs setattr
2 2 1.0 0.0 0.5 $max - irix.nfs3.client.reqs lookup
2 3 0.5 1.0 0.0 $max - irix.nfs3.client.reqs readdir
2 4 0.0 1.0 0.0 $max - irix.nfs3.client.reqs fsstat
2 5 0.0 0.0 1.0 $max - irix.nfs3.client.reqs access
2 6 1.0 0.0 0.0 $max - irix.nfs3.client.reqs readdir+
2 7 0.0 1.0 1.0 $max - irix.nfs3.client.reqs fsinfo
2 8 1.0 1.0 0.0 $max - irix.nfs3.client.reqs pathconf
3 0 0.0 0.0 1.0 $max clnt-data irix.nfs3.client.reqs readlink
3 1 1.0 0.0 0.0 $max - irix.nfs3.client.reqs read
3 2 0.0 1.0 1.0 $max - irix.nfs3.client.reqs write
3 3 1.0 0.5 0.0 $max - irix.nfs3.client.reqs commit
End-of-File
fi
fi
$verbose && cat $tmp.config
eval /usr/sbin/pmview <$tmp.config $args -title "'$titleArg'" -xrm "'*iconName: nfsvis'"
exit